package org.zsl.lesson4_aop.service.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LogAspect {

    @Pointcut("execution(* org.zsl.lesson4_aop..*.*(..))")
    public void  pc(){

    }

//    @Before("execution(* org.zsl.lesson4_aop..*.*(..))")
//    public  void before(JoinPoint joinPoint){
//
//        System.out.println(joinPoint.getSignature());
//        System.out.println("正在执行日志记录");
//    }

//    @After("pc()")
//    public  void after(){
//
//    }

    @Around("pc()")
    public void around(ProceedingJoinPoint joinPoint) throws Throwable {

        System.out.println("这是环绕通知.....");
        joinPoint.proceed();
        System.out.println("这是环绕通知.....");
    }

//    @AfterReturning("pc()")
//    public  void afterReturn(){
//
//    }
//    @AfterThrowing("pc()")
//    public void throwing(){
//
//    }
}
